<?php
include($folder.'/layouts/code-behind/backend.php');
if ($_SESSION['id']!==null)
{
	query('INSERT INTO archive (created, subject) VALUES (now(), 0)', null);
	header('Content-Disposition: attachment; filename="homedir_'.date('Y-m-d_Hi').'.tar.gz"');
	$options = array(
		'http' => array(
			'method' => 'GET',
			'header' => 'Authorization: basic '.base64_encode('kincsker:'.$db_password)."\r\n\r\n"			  
		)
	);
	$context = stream_context_create($options);
	$fp = fopen('http://87.229.73.63:2082/getbackup/homedir.tar.gz', 'r', false, $context);
	fpassthru($fp);
	fclose($fp);
	die();
}
?>